package com.ruoyi.peizhen.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.peizhen.mapper.BusinessLabelMapper;
import com.ruoyi.peizhen.domain.BusinessLabel;
import com.ruoyi.peizhen.service.IBusinessLabelService;
import com.ruoyi.common.core.text.Convert;

/**
 * 标签Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-13
 */
@Service
public class BusinessLabelServiceImpl implements IBusinessLabelService 
{
    @Autowired
    private BusinessLabelMapper businessLabelMapper;

    /**
     * 查询标签
     * 
     * @param id 标签主键
     * @return 标签
     */
    @Override
    public BusinessLabel selectBusinessLabelById(Long id)
    {
        return businessLabelMapper.selectBusinessLabelById(id);
    }

    /**
     * 查询标签列表
     * 
     * @param businessLabel 标签
     * @return 标签
     */
    @Override
    public List<BusinessLabel> selectBusinessLabelList(BusinessLabel businessLabel)
    {
        return businessLabelMapper.selectBusinessLabelList(businessLabel);
    }

    /**
     * 新增标签
     * 
     * @param businessLabel 标签
     * @return 结果
     */
    @Override
    public int insertBusinessLabel(BusinessLabel businessLabel)
    {
        businessLabel.setCreateTime(DateUtils.getNowDate());
        return businessLabelMapper.insertBusinessLabel(businessLabel);
    }

    /**
     * 修改标签
     * 
     * @param businessLabel 标签
     * @return 结果
     */
    @Override
    public int updateBusinessLabel(BusinessLabel businessLabel)
    {
        businessLabel.setUpdateTime(DateUtils.getNowDate());
        return businessLabelMapper.updateBusinessLabel(businessLabel);
    }

    /**
     * 批量删除标签
     * 
     * @param ids 需要删除的标签主键
     * @return 结果
     */
    @Override
    public int deleteBusinessLabelByIds(String ids)
    {
        return businessLabelMapper.deleteBusinessLabelByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除标签信息
     * 
     * @param id 标签主键
     * @return 结果
     */
    @Override
    public int deleteBusinessLabelById(Long id)
    {
        return businessLabelMapper.deleteBusinessLabelById(id);
    }
}
